// JSHumanizer, version 0.0
// Copyright © 2010, Richard Cook.
// http://jshumanizer.googlecode.com/
//
// This file is part of JSHumanizer.
 //
// JSHumanizer is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the licence or
// (at your option) any later version.
//
// JSHumanizer is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with JSHumanizer. If not, see <http://www.gnu.org/licenses/>.

var JSHumanizer = (function(self) {
  var days = {
    0: "Sunday",
    1: "Monday",
    2: "Tuesday",
    3: "Wednesday",
    4: "Thursday",
    5: "Friday",
    6: "Saturday"
  };
  var months = {
    0: "January",
    1: "February",
    2: "March",
    3: "April",
    4: "May",
    5: "June",
    6: "July",
    7: "August",
    8: "September",
    9: "October",
    10: "November",
    11: "December"
  };

  self.getFullDateTimeString = function(date_time) {
    return self.getFullDateString(date_time) + " at " + self.getFullTimeString(date_time);
  };

  self.getFullDateString = function(date_time) {
    return days[date_time.getDay()] + ", " +
      months[date_time.getMonth()] + " " +
      date_time.getDate() + ", " +
      date_time.getFullYear();
  };

  self.getLongDateString = function(date_time) {
    return months[date_time.getMonth()] + " " +
      date_time.getDate() + ", " +
      date_time.getFullYear();
  };

  self.getCommonDateString = function(date_time) {
    return (date_time.getMonth() + 1) + "/" +
      date_time.getDate() + "/" +
      date_time.getFullYear();
  };

  self.getShortDateString = function(date_time) {
    return self.__zeroPad(date_time.getMonth() + 1, 2) + "." +
      self.__zeroPad(date_time.getDate(), 2) + "." +
      self.__zeroPad(date_time.getFullYear() % 100, 2);
  };

  self.getFullTimeString = function(date_time) {
    return self.__zeroPad(date_time.getHours(), 2) + ":" + 
      self.__zeroPad(date_time.getMinutes(), 2) + ":" +
      self.__zeroPad(date_time.getSeconds(), 2);
  };

  self.humanizeInt = function(value) {
    return self.__humanizeIntHelper(value, 3, ",");
  };

  self.humanizeDecimal = function(value, decimal_places) {
    return self.__humanizeDecimalHelper(value, decimal_places, ".", 3, ",");
  };

  return self;
}(JSHumanizer || {}));

